package com.yanqu.road.logic.bussiness.union;

import com.yanqu.road.entity.union.*;
import com.yanqu.road.logic.bussiness.DaoHelper;

import java.util.LinkedList;
import java.util.List;
import java.util.Map;

public class UnionBussiness {

	public static long getMaxUnionAliasId() {
		return DaoHelper.getUnionInfoDaoImpl().getMaxUnionAliasId();
	}

	public static void getUnionInfoMap(Map<String, UnionInfo> unionInfoMap, Map<String, UnionInfo> deleteUnionInfoMap) {
		DaoHelper.getUnionInfoDaoImpl().getUnionInfoMap(unionInfoMap, deleteUnionInfoMap);
	}

	public static List<UnionInfo> getUnionInfoList(int maxCount) {
		return DaoHelper.getUnionInfoDaoImpl().getUnionInfoList(maxCount);
	}

	public static boolean addUnionInfo(UnionInfo unionInfo) {
		return DaoHelper.getUnionInfoDaoImpl().add(unionInfo);
	}

	public static boolean updateUnionInfo(UnionInfo unionInfo) {
		return DaoHelper.getUnionInfoDaoImpl().update(unionInfo);
	}

	public static void getUnionMemberMap(Map<String, Map<Long, UnionMember>> unionMemberMap, Map<Long, UnionMember> deleteUnionMemberMap){
		DaoHelper.getUnionMemberDaoImpl().getUnionMemberMap(unionMemberMap, deleteUnionMemberMap);
	}

	public static boolean addUnionMember(UnionMember unionMember) {
		return DaoHelper.getUnionMemberDaoImpl().add(unionMember);
	}

	public static boolean updateUnionMember(UnionMember unionMember) {
		return DaoHelper.getUnionMemberDaoImpl().update(unionMember);
	}

	public static Map<String, LinkedList<UnionNotice>> getUnionNoticeMap(long selectTime, int maxCount){
		return DaoHelper.getUnionNoticeDaoImpl().getUnionNoticeMap(selectTime, maxCount);
	}

	public static boolean addUnionNotice(UnionNotice unionNotice) {
		return DaoHelper.getUnionNoticeDaoImpl().add(unionNotice);
	}

	public static boolean addUnionFlag(UnionFlag flag) {
		return DaoHelper.getUnionFlagDaoImpl().add(flag);
	}

	public static boolean updateUnionFlag(UnionFlag flag) {
		return DaoHelper.getUnionFlagDaoImpl().update(flag);
	}

	public static Map<String, Map<Integer, UnionFlag>> getAllUnionFlag() {
		return DaoHelper.getUnionFlagDaoImpl().getUnionFlag();
	}
}
